import instance from './index';
import qs from 'qs';

const preUrlPath = '';
//获取币种列表-分页
const request = {
  p: ['api:user:fetch'],
  r: params => {
    return instance.get(`/v1/coin/fetchPageList`, {params}).catch(function(res){
      console.log(res)
    })
  }
};
//设置币种状态
const setStatus = {
  p: ['api:user:fetch'],
  r: params => {
    return instance.get(`/v1/coin/setCoinStatus`, {params}).catch(function(res){
      console.log(res)
    })
  }
};
//添加币种
const add = {
  p: ['api:user:new'],
  r: params => {
    return instance.post(`/v1/coin/new`, qs.stringify(params),{ headers:{'Content-Type':'application/x-www-form-urlencoded'}}).catch(function(res){
      console.log(res)
    })
  }
};
//获取币种信息
const info = {
  p: ['get'],
  r: params => {
    return instance.get(`/v1/coin/info`, {params}).catch(function(res){
      console.log(res)
    })
  }
};
//编辑币种
const modify = {
  p: ['api:user:modify'],
  r: params => {
    return instance.post(`/v1/coin/modify`, qs.stringify(params),{ headers:{'Content-Type':'application/x-www-form-urlencoded'}}).catch(function(res){
      console.log(res)
    })
  }
};

export {
  request,
  add,
  modify,
  info,
  setStatus,

}
